package com.dangs.rtmp.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.dangs.rtmp.R;

public class StartActivity extends Activity {
    public static final String RTMPURL_MESSAGE = "com.alex.com.alex.livertmppushsdk.demo.rtmpurl";

    private Button _startRtmpPushButton = null;
    private EditText _rtmpUrlEditText = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        InitUI();
    }

    private void InitUI() {
        _rtmpUrlEditText = findViewById(R.id.rtmpUrleditText);
        _startRtmpPushButton = findViewById(R.id.startRtmpButton);
        _rtmpUrlEditText.setText("rtmp://192.168.0.220:1935/live/1234");
        _startRtmpPushButton.setOnClickListener(view -> {
            String rtmpUrl = _rtmpUrlEditText.getText().toString();
            startActivity(new Intent(this, MainActivity.class).putExtra(RTMPURL_MESSAGE, rtmpUrl));
        });
    }


}
